<page-header [action]="phActionTpl">
  <ng-template #phActionTpl>
    <button (click)="add()" nz-button nzType="primary">新建</button>
  </ng-template>
</page-header>

<nz-card [nzBordered]="false">
  <form nz-form se-container="1" size="compact" [gutter]="32" [labelWidth]="null">
    <se label="费用分组" line>
      <tag-select>
        <nz-tag *ngFor="let i of chrgitmTypeGrpList; let idx = index" nzMode="checkable"
          (nzCheckedChange)="changeTypeGrp(i.chrgitmTypeGrpCode)">
          {{ i.chrgitmTypeGrpName }}
        </nz-tag>
      </tag-select>
    </se>
    <se label="收费类别">
      <tag-select>
        <nz-tag *ngFor="let i of chrgitmTypeList; let idx = index" nzMode="checkable"
          (nzCheckedChange)="changeType(i.chrgitmTypeCodg)">
          {{ i.chrgitmTypeName }}
        </nz-tag>
      </tag-select>
    </se>
  </form>
</nz-card>

<nz-card>
  <sf #sf mode="search" [schema]="searchSchema" (formSubmit)="st.reset($event)" (formReset)="st.reset($event)"></sf>
  <st #st [data]="url" [columns]="columns" [res]="{ reName: { list: 'items' ,total: 'totalCount'} }"
    [req]="{reName: { pi: 'skipCount' ,ps: 'maxResultCount'}}"></st>
</nz-card>

<div>
  <nz-drawer [nzMaskClosable]="false" [nzWidth]="650" [nzVisible]="editVisible" [nzTitle]="detailTitle"
    [nzFooter]="footerTpl" (nzOnClose)="close()">
    <div nz-col nzXs="24" nzSm="24" nzMd="8">
      <form nz-form *nzDrawerContent [formGroup]="editForm" se-container="1" labelWidth="100">
        <se label="收费类别" error="请填写">
          <nz-select formControlName="chargeItemTypeValue" nzPlaceHolder="选择" required
            (ngModelChange)="selecteOptionChange($event)">
            <nz-option *ngFor="let medChrgitmType of chrgitmTypeList" [nzLabel]="medChrgitmType.label"
              [nzValue]="medChrgitmType.value"></nz-option>
          </nz-select>
        </se>
        <se label="项目名称" error="请填写">
          <input nz-input required formControlName="chargeItemLabel" placeholder="项目名称" />
        </se>
        <se label="单价">
          <input nz-input required formControlName="price" placeholder="单价" />
        </se>
        <se label="规格">
          <input nz-input required formControlName="spec" placeholder="规格" />
        </se>
        <se label="单位">
          <input nz-input required formControlName="unit" placeholder="单位" />
        </se>
        <se label="物价码">
          <input nz-input formControlName="priceCode" placeholder="物价码" />
        </se>
        <se label="有效性">
          <nz-switch formControlName="valid"></nz-switch>
        </se>
      </form>
    </div>

    <ng-template #footerTpl>
      <div style="float: right">
        <button nz-button class="mr8" (click)="close()">取消</button>
        <button nz-button nzType="primary" (click)="save()">保存</button>
      </div>
    </ng-template>
  </nz-drawer>
</div>
